package com.greenant.store.activity;

import com.greenant.store.AntHomeApplication;
import com.greenant.store.R;
import com.greenant.store.version.DownloadManager;
import com.lsarah.utils.SystemBarTintManager;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public class AboutAppActivity extends BaseActivity {
	TextView text;

	@Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        SystemBarTintManager.setContentView(this, R.layout.about,
            getResources().getColor(R.color.green));
        text = (TextView) findViewById(R.id.about_text);

        if (TextUtils.isEmpty(AntHomeApplication.newVersonName))
        {
            text.setText("");
        } else
        {
            text.setText("V"+AntHomeApplication.newVersonName);
        }

        findViewById(R.id.tv_disclaimer).setOnClickListener(
            new OnClickListener()
            {

                @Override
                public void onClick(View v)
                {
                    showDisclaimer(v);
                }
            });
    }

	public void goBack(View view) {
		finish();
	}

	public void showDisclaimer(View view) {
		Intent intent = new Intent(this, DisclaimerActivity.class);
		startActivity(intent);
	}

	// 检查更新
	public void checkUpdate(View view) {
	    //检查更新
        DownloadManager downloadManager=new DownloadManager(this,true,true);
        downloadManager.checkDownload();
	}


	// 功能介绍
	public void descFunc(View view) {
		Intent intent = new Intent(this, DescFuncActivity.class);
		startActivity(intent);
	}

}
